The present invention relates to a method of analyzing and converting bi-level image data, applicable to, for example, line-density conversion in a facsimile machine.
Devices that transfer and store image data sometimes convert the line density of the data. For example, image data having a density of six hundred dot-lines per inch (600 dpi) are sometimes reduced to three hundred dot-lines per inch (300 dpi), and 300-dpi image data are sometimes converted to 600-dpi data. The former process compresses the amount of data, while the latter process expands the data. These processes are carried out in facsimile transmissions between facsimile machines that print and scan with different line densities, for example.
A simple method of reducing the line density of an input image is to discard every second line. Another method generates a single new dot line by performing bit-wise logical OR operations on the bit-mapped dot data of pairs of adjacent dot lines in the image. A simple method of increasing the line density copies each dot line of the input image to two dot lines in the output image. Another method generates interpolated dot lines by performing bit-wise comparisons on pairs of adjacent bit-mapped dot lines.
The processes that simply copy and discard dot lines can be carried out at high speed, but they lead to image defects, such as jagged contours, and discontinuities in nearly horizontal fine lines. Bit-wise logical operations and comparisons can prevent these image defects, but these operations take time. In facsimile transmissions, for example, they can limit the transmission speed.
There is thus a need for a line-density conversion method that is fast, but does not leave image defects. There is also a general need for high-speed methods of analyzing bi-level images for such purposes as removal of dot noise and smoothing of contours.
One object of the present invention is to provide a high-speed method of analyzing a bi-level image.
Another object is to provide a high-speed method of generating new dot lines from existing dot lines in a bi-level image, achieving results equivalent to the results achieved by bit-wise logical operations and comparisons.
In the invented method of analyzing a bi-level image, the image is coded as transition data indicating positions of transitions between a first level and a second level in individual dot lines oriented in a first direction. The method comprises the steps of:
(a) reading transition positions occurring in a consecutive group of dot lines;
(b) comparing the transition positions in different dot lines in the group; and
(c) detecting segments in different dot lines in the group that have the first level, and are mutually joined in the first direction.
The invention also provides a method of generating transition data for a new dot line by using steps (a), (b), and (c) to analyze the image. This method copies the transition data read in step (a), omitting interior transition positions of the mutually joined segments detected in step (c). In addition, the invention provides an image-processing apparatus that reduces the line density of a bi-level image by generating a new dot line in this way from a pair of adjacent dot lines in the bi-level image.
The invention furthermore provides a method and apparatus for interpolating a new dot line between a first dot line and a second dot line in a bi-level image, by using steps (a), (b), and (c) to detect segments in the first dot line that join with segments in the second dot line. For each such segment detected in the first dot line, a first joining segment and a last joining segment are detected in the second dot line. Transition data for the interpolated dot line are created by copying the transition data of the first dot line, adjusting the transition positions of segments detected in step (c) in the first dot line according to the transition positions of the first and last joining segments in the second dot line.
The invented method of analyzing a bi-level image can also be used for dot-noise removal and contour smoothing.
The invented methods are fast because they operate on transition data, instead of bit-mapped image data.